{% extends 'layout.html' %}


{% block content %}

<div class="container">
            <div style="margin-bottom: 10px">
                <a class="btn btn-primary" href="/user/list/1" target="_blank">新建员工</a>
            </div>
            <div>
                <div class="panel panel-default">
                    <!-- Default panel contents -->
                    <div class="panel-heading">
                        <span class="glyphicon glyphicon-th-list" aria-hidden="true" style="margin-right: 5px;"></span>
                        <span>员工列表</span>
                    </div>

                    <!-- Table -->
                    <table class="table table-bordered">
                        <thead>
                            <tr>
                                <th>ID</th>
                                <td>姓名</td>
                                <td>密码</td>
                                <td>年龄</td>
                                <td>工资</td>
                                <td>入职时间</td>
                                <td>部门</td>
                                <td>性别</td>
                                <td>操作</td>

                            </tr>
                        </thead>
                        <tbody>
                            {% for obj in user_list %}
                            <tr>
                                <th>{{ obj.id }}</th>
                                <td>{{ obj.name }}</td>
                                <td>{{ obj.password }}</td>
                                <td>{{ obj.age }}</td>
                                <td>{{ obj.account }}</td>
                                <td>{{ obj.create_time }}</td>
                                <td>{{ obj.depart.title }}</td>
                                <td>{{ obj.sex }}</td>

                                <td>
                                    <a class="btn btn-primary btn-xs" href="/user/{{ obj.id }}/edit">编辑</a>
                                    <a  class="btn btn-danger btn-xs" href="/user/del/?nid={{ obj.id }}">删除</a>
                                </td>
                            </tr>
                            {% endfor %}
                        </tbody>
                    </table>

                </div>
            <ul class="pagination">
    {{ page_string }}
</ul>

<form method="get">
    <div style="display:inline-block; width: 150px;">
        <div class="input-group">
            <span> <input type="text" class="form-control" placeholder="请输入页码" name="page"></span>
            <span class="input-group-btn">
                <button class="btn btn-primary" type="submit">跳转</button>
            </span>
        </div>
    </div>
</form>
            </div>
        </div>

{% endblock %}
